import { request } from './client.js';

async function createOAuth() {
  return request("/oauth", {
    method: "POST"
  });
}
async function pollOAuth(options) {
  const { token } = options;
  return request(`/oauth/${token}/poll`);
}
async function verifyOAuth(options) {
  const { secret, token } = options;
  return request(`/oauth/${token}/verify`, {
    method: "PUT",
    body: { secret }
  });
}

export { createOAuth, pollOAuth, verifyOAuth };
